home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 78 / CD Actual 78 Mayo 2003.iso / Linux / LinuxGazette / lg / issue89 / misc / danguer / variables_select.xsl < prev    next >
Encoding:
Extensible Markup Language  |  2003-02-17  |  685 b   |  28 lines

  1. <!-- variables_select.xsl -->
  2.  
  3. <xsl:stylesheet version="1.0"
  4.                   xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  5.  
  6.  
  7. <xsl:template match="/"> 
  8.     <html>
  9.        <head>
  10.          <title>Examples of Variables</title>
  11.         </head>
  12.        <body>
  13.            <xsl:apply-templates select="//photo"/>
  14.        </body>
  15.     </html>
  16. </xsl:template>
  17.  
  18. <xsl:template match="photo"> 
  19.     <!--  definition of the variables  -->
  20.     <xsl:variable name="path">http://somedomain/tmp/xslt</xsl:variable>  
  21.     <xsl:variable name="photo" select="file"/> 
  22.      <p> 
  23.        <a href="{$path}/{$photo}"><xsl:value-of select="description"/></a>
  24.      </p>       
  25. </xsl:template>
  26.  
  27. </xsl:stylesheet>
  28.